/*******************************************************************************
* This file provides the API for MPXV7002 pressure sensor.
* Also implements the algorithm to calculate the airspeed.
*
* Author: Kong Wai Weng
* Email:  waiweng83@gmail.com
*******************************************************************************/



#ifndef _AIRSPEED_H
#define _AIRSPEED_H



#include <math.h>
#include "FreeRTOS.h"
#include "task.h"
#include "system.h"
#include "hal_adc.h"
#include "hal_bmp085.h"
#include "variables.h"



/*******************************************************************************
* PUBLIC FUNCTION PROTOTYPES                                                   *
*******************************************************************************/

/*******************************************************************************
* PUBLIC FUNCTION: fGetAirspeed
*
* PARAMETERS:
* ~ void
*
* RETURN:
* ~ Airspeed (m/s).
*
* DESCRIPTIONS:
* Read the calculated airspeed.
*
*******************************************************************************/
float fGetAirspeed(void);



/*******************************************************************************
* TASK: taskAirspeedLoop
*
* DESCRIPTIONS:
* This task is the main loop to calculate the airspeed base on the data from
* the MPSV7002 differential pressure sensor.
*
*******************************************************************************/
portTASK_FUNCTION_PROTO(taskAirspeedLoop, pvParameters);



#endif
